import request from '@/utils/request'

// 查询生产退料单结果列表
export function listDetail(query) {
  return request({
    url: '/mes/pro/back/detail/list',
    method: 'get',
    params: query
  })
}

// 查询基础表中的所有生产退料单
export function listAllDetail(query) {
  return request({
    url: '/mes/pro/back/detail/allList',
    method: 'get',
    params: query
  })
}

export function listAllDetailid(backId) {
  return request({
    url: '/mes/pro/back/detail/allList/notPage/'+backId,
    method: 'get',
    // params: query
  })
}

// 根据物料序列号查询生产退料单明细
export function listByMaterialSerial(query) {
  return request({
    url: '/mes/pro/back/detail/listByMaterialSerial',
    method: 'get',
    params: query
  })
}

// 查询生产退料单结果详细
export function getDetail(id) {
  return request({
    url: '/mes/pro/back/detail/' + id,
    method: 'get'
  })
}

// 新增生产退料单结果
export function addDetail(data) {
  return request({
    url: '/mes/pro/back/detail',
    method: 'post',
    data: data
  })
}

// 修改生产退料单结果
export function updateDetail(data) {
  return request({
    url: '/mes/pro/back/detail',
    method: 'put',
    data: data
  })
}

// 删除生产退料单结果
export function delDetail(id) {
  return request({
    url: '/mes/pro/back/detail/' + id,
    method: 'delete'
  })
}


// /pro/back/detail/{backId}/{ids}
//删除物料信息
export function delDelete(backId,ids) {
  return request({
    url:`/mes/pro/back/detail/${backId}/${ids}`,
    method: 'delete'
  })
}